import time
st = time.clock()
from fractions import Fraction

limit = 12000
max_res = set()
max_limit = Fraction(1,2)
min_limit = Fraction(1,3)
for d in range(1,limit+1):
    for n in range(int(1/3*d)-1,int(1/2*d)+1):
        llv = Fraction(n, d)
        if max_limit > llv > min_limit:
            max_res.add(llv)
            print(llv)

print(len(max_res))

print(time.clock()-st)